package b.b.h;

import android.content.res.ColorStateList;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.widget.CompoundButton;
import b.i.b.f;

/* compiled from: AppCompatCompoundButtonHelper */
public class d {
    public final CompoundButton a;
    public ColorStateList b = null;
    public Mode c = null;
    public boolean d = false;
    public boolean e = false;
    public boolean f;

    public d(CompoundButton compoundButton) {
        this.a = compoundButton;
    }

    public void a() {
        Drawable t0 = f.t0(this.a);
        if (t0 == null) {
            return;
        }
        if (this.d || this.e) {
            t0 = f.k1(t0).mutate();
            if (this.d) {
                t0.setTintList(this.b);
            }
            if (this.e) {
                t0.setTintMode(this.c);
            }
            if (t0.isStateful()) {
                t0.setState(this.a.getDrawableState());
            }
            this.a.setButtonDrawable(t0);
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:11:0x0039 A:{SYNTHETIC, Splitter:B:11:0x0039} */
    /* JADX WARNING: Removed duplicated region for block: B:19:0x0059 A:{Catch:{ all -> 0x0063 }} */
    /* JADX WARNING: Removed duplicated region for block: B:24:0x006c A:{Catch:{ all -> 0x0063 }} */
    public void b(android.util.AttributeSet r10, int r11) {
        /*
        r9 = this;
        r0 = r9.a;
        r0 = r0.getContext();
        r3 = b.b.b.l;
        r8 = 0;
        r0 = b.b.h.f0.q(r0, r10, r3, r11, r8);
        r1 = r9.a;
        r2 = r1.getContext();
        r5 = r0.b;
        r7 = 0;
        r4 = r10;
        r6 = r11;
        b.i.k.o.o(r1, r2, r3, r4, r5, r6, r7);
        r10 = 1;
        r11 = r0.o(r10);	 Catch:{ all -> 0x0063 }
        if (r11 == 0) goto L_0x0036;
    L_0x0022:
        r11 = r0.l(r10, r8);	 Catch:{ all -> 0x0063 }
        if (r11 == 0) goto L_0x0036;
    L_0x0028:
        r1 = r9.a;	 Catch:{ NotFoundException -> 0x0036 }
        r2 = r1.getContext();	 Catch:{ NotFoundException -> 0x0036 }
        r11 = b.b.d.a.a.b(r2, r11);	 Catch:{ NotFoundException -> 0x0036 }
        r1.setButtonDrawable(r11);	 Catch:{ NotFoundException -> 0x0036 }
        goto L_0x0037;
    L_0x0036:
        r10 = 0;
    L_0x0037:
        if (r10 != 0) goto L_0x0052;
    L_0x0039:
        r10 = r0.o(r8);	 Catch:{ all -> 0x0063 }
        if (r10 == 0) goto L_0x0052;
    L_0x003f:
        r10 = r0.l(r8, r8);	 Catch:{ all -> 0x0063 }
        if (r10 == 0) goto L_0x0052;
    L_0x0045:
        r11 = r9.a;	 Catch:{ all -> 0x0063 }
        r1 = r11.getContext();	 Catch:{ all -> 0x0063 }
        r10 = b.b.d.a.a.b(r1, r10);	 Catch:{ all -> 0x0063 }
        r11.setButtonDrawable(r10);	 Catch:{ all -> 0x0063 }
    L_0x0052:
        r10 = 2;
        r11 = r0.o(r10);	 Catch:{ all -> 0x0063 }
        if (r11 == 0) goto L_0x0065;
    L_0x0059:
        r11 = r9.a;	 Catch:{ all -> 0x0063 }
        r10 = r0.c(r10);	 Catch:{ all -> 0x0063 }
        r11.setButtonTintList(r10);	 Catch:{ all -> 0x0063 }
        goto L_0x0065;
    L_0x0063:
        r10 = move-exception;
        goto L_0x0081;
    L_0x0065:
        r10 = 3;
        r11 = r0.o(r10);	 Catch:{ all -> 0x0063 }
        if (r11 == 0) goto L_0x007b;
    L_0x006c:
        r11 = r9.a;	 Catch:{ all -> 0x0063 }
        r1 = -1;
        r10 = r0.j(r10, r1);	 Catch:{ all -> 0x0063 }
        r1 = 0;
        r10 = b.b.h.o.c(r10, r1);	 Catch:{ all -> 0x0063 }
        r11.setButtonTintMode(r10);	 Catch:{ all -> 0x0063 }
    L_0x007b:
        r10 = r0.b;
        r10.recycle();
        return;
    L_0x0081:
        r11 = r0.b;
        r11.recycle();
        throw r10;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.b.h.d.b(android.util.AttributeSet, int):void");
    }
}
